package design2.observer.example.listeners;

import java.io.File;

/**
 * 收到通知后日志中记录一条信息
 */
public class LogOpenListener implements EventListener {

    private File log;

    public LogOpenListener(String fileName) {
        this.log = new File(fileName);
    }

    @Override
    public void update(String eventType, File file) {
        System.out.println("保存到日志"+log+"：有人对以下文件执行了"+eventType+" 操作："+file.getName());

    }
}
